package com.item.daoEx;

import java.util.List;

import com.item.dao.model.Order;
import com.item.dao.model.OrderItem;

public class OrderEx extends Order {
	private List<OrderItem> items;
	
	private String firstBName = "";
	
	public OrderEx(Order order) {
		this.setAddress(order.getAddress());
		this.setCreateTime(order.getCreateTime());
		this.setId(order.getId());
		this.setModifyTime(order.getModifyTime());
		this.setPhone(order.getPhone());
		this.setSid(order.getSid());
		this.setsName(order.getsName());
		this.setUserid(order.getUserid());
		this.setUsername(order.getUsername());
		this.setStatus(order.getStatus());
	}

	public List<OrderItem> getItems() {
		return items;
	}

	public void setItems(List<OrderItem> items) {
		this.items = items;
		if(items.size() > 0) {
			this.firstBName = items.get(0).getBookName();
		}
		if(items.size() > 1) {
			this.firstBName += "等";
		}
	}

	public String getFirstBName() {
		return firstBName;
	}

	public void setFirstBName(String firstBName) {
		this.firstBName = firstBName;
	}
}
